import React, { Suspense } from 'react'
import { RouterProvider } from 'react-router-dom'
import { router } from './router'
import { LoadingSpinner } from './components/ui/loading-spinner'
import { NotificationContainer } from './components/ui/notification-container'
import { ErrorBoundary } from './components/ui/error-boundary'

/**
 * 主应用组件
 * 使用新的架构：Provider模式 + 布局组件 + 错误边界
 */
function App() {
  return (
    <ErrorBoundary>
      <Suspense fallback={<LoadingSpinner />}>
        <RouterProvider router={router} />
      </Suspense>
      <NotificationContainer />
    </ErrorBoundary>
  )
}

export default App
